/*******************************************************************************************************

Table A11: Difference-in-differences estimates: Post-treatment period restricted to
1833 and 1834; controls for population.

*******************************************************************************************************/


*Set directory path
cd "C:\Users\tsa23\Documents\petitions\replication files"

clear all

*read in our main dataset
use dta/did_rep.dta

*Elminate contrituencies which are not part of case G
drop if ID == 45 //University of Cambridge
drop if ID == 191 //University of Oxford
keep if new == 1 | drummond == .

gen treatgroup = 0
replace treatgroup =  1 if new==1 

gen treatinter = treatperiod*treatgroup

drop if year==1830 | year==1831 | year==1832
drop if year>1834 ///Reduces post-treatment period to 1833-34


collapse ln_petitions treatgroup, by(ID treatperiod treatinter)

label var treatinter "T * A" 
label var treatgroup "T"
label var treatperiod "A"
label var ln_petitions "Log all petitions"

reg ln_petitions treatinter treatgroup treatperiod, cl(ID)
outreg2 treatinter treatgroup treatperiod using results\tableA11, nocons replace addt(Constituencies, 135, Treatment, G, Post period, 1833-34) asterisk(coef) auto(2) label ctitle(Log (petitions + 1)) keep(treatinter treatgroup treatperiod) se  symbol(**,*,+) tex(frag)

clear all

*read in our main dataset
use dta/did_rep.dta

*Elminate contrituencies which are not part of case L
drop if ID == 45 //University of Cambridge
drop if ID == 191 //University of Oxford
keep if sch_A==1 | sch_B == 1 | drummond!=.

gen treatgroup = 0
replace treatgroup =  1 if sch_A==1 

gen treatinter = treatperiod*treatgroup

drop if year==1830 | year==1831 | year==1832
drop if year>1834 ///Reduces post-treatment period to 1833-34

collapse ln_petitions treatgroup, by(ID treatperiod treatinter)

label var treatinter "T * A" 
label var treatgroup "T"
label var treatperiod "A"
label var ln_petitions "Log all petitions"

reg ln_petitions treatinter treatgroup treatperiod, cl(ID)
outreg2 treatinter treatgroup treatperiod using results\tableA11, nocons append addt(Constituencies, 120, Treatment, L, Post period, 1833-34) asterisk(coef) auto(2) label ctitle(Log (petitions + 1)) keep(treatinter treatgroup treatperiod) se  symbol(**,*,+) tex(frag)

clear all

*read in our main dataset
use dta/did_rep.dta

*Elminate contrituencies which are not part of case G
drop if ID == 45 //University of Cambridge
drop if ID == 191 //University of Oxford
keep if new == 1 | drummond == .

gen treatgroup = 0
replace treatgroup =  1 if new==1 

gen treatinter = treatperiod*treatgroup

drop if year==1830 | year==1831 | year==1832

collapse ln_petitions ln_pop_i ln_pop_i_SQ treatgroup, by(ID treatperiod treatinter)

label var treatinter "T * A" 
label var treatgroup "T"
label var treatperiod "A"
label var ln_petitions "Log all petitions"
label var ln_pop_i "Log Population"
label var ln_pop_i_SQ "Log Population squared"

reg ln_petitions treatinter treatgroup treatperiod ln_pop_i, cl(ID)
outreg2 treatinter treatgroup treatperiod ln_pop_i ln_pop_i_SQ using results\tableA11, nocons append addt(Constituencies, 135, Treatment, G, Post period, 1833-38) asterisk(coef) auto(2) label ctitle(Log (petitions + 1)) keep(treatinter treatgroup treatperiod ln_pop_i ln_pop_i_SQ) se  symbol(**,*,+) tex(frag)

reg ln_petitions treatinter treatgroup treatperiod ln_pop_i ln_pop_i_SQ, cl(ID)
outreg2 treatinter treatgroup treatperiod ln_pop_i ln_pop_i_SQ using results\tableA11, nocons append addt(Constituencies, 135, Treatment, G, Post period, 1833-38) asterisk(coef) auto(2) label ctitle(Log (petitions + 1)) keep(treatinter treatgroup treatperiod ln_pop_i ln_pop_i_SQ) se  symbol(**,*,+) tex(frag)


clear all

*read in our main dataset
use dta/did_rep.dta

*Elminate contrituencies which are not part of case L
drop if ID == 45 //University of Cambridge
drop if ID == 191 //University of Oxford
keep if sch_A==1 | sch_B == 1 | drummond!=.

gen treatgroup = 0
replace treatgroup =  1 if sch_A==1 

gen treatinter = treatperiod*treatgroup

drop if year==1830 | year==1831 | year==1832

collapse ln_petitions ln_pop_i ln_pop_i_SQ treatgroup, by(ID treatperiod treatinter)

label var treatinter "T * A" 
label var treatgroup "T"
label var treatperiod "A"
label var ln_petitions "Log all petitions"
label var ln_pop_i "Log Population"
label var ln_pop_i_SQ "Log Population squared"

reg ln_petitions treatinter treatgroup treatperiod ln_pop_i, cl(ID)
outreg2 treatinter treatgroup treatperiod ln_pop_i ln_pop_i_SQ using results\tableA11, nocons append addt(Constituencies, 120, Treatment, L, Post period, 1833-38) asterisk(coef) auto(2) label ctitle(Log (petitions + 1)) keep(treatinter treatgroup treatperiod ln_pop_i ln_pop_i_SQ) se  symbol(**,*,+) tex(frag)

reg ln_petitions treatinter treatgroup treatperiod ln_pop_i ln_pop_i_SQ, cl(ID)
outreg2 treatinter treatgroup treatperiod ln_pop_i ln_pop_i_SQ using results\tableA11, nocons append addt(Constituencies, 120, Treatment, L, Post period, 1833-38) asterisk(coef) auto(2) label ctitle(Log (petitions + 1)) keep(treatinter treatgroup treatperiod ln_pop_i ln_pop_i_SQ) se  symbol(**,*,+) tex(frag)
